package watercups.states;

import java.util.ArrayList;
import templates.State;

public class WaterCupState {
	
	protected int capacity1;
	protected int capacity2;
	
	public WaterCupState() {
		//super();
		capacity1 = 0;
		capacity2 = 0;	
	}
	
	public WaterCupState(int capacity1, int capacity2) {
		super();
		this.capacity1 = capacity1;
		this.capacity2 = capacity2;
	}

	public int getCapacity1() {
		return capacity1;
	}

	public void setCapacity1(int capacity1) {
		this.capacity1 = capacity1;
	}

	public int getCapacity2() {
		return capacity2;
	}

	public void setCapacity2(int capacity2) {
		this.capacity2 = capacity2;
	}


	public String toString() {
		return "Starea [capacity1=" + capacity1 + ", capacity2="+ capacity2 + "]";
	}
	
	
	 public boolean equals(Object s){
		  boolean r=false;
		  WaterCupState a=(WaterCupState)s;
		  if(a.capacity1==this.capacity1 && a.capacity2==this.capacity2)
			  r=true;
		  return r;
	  }
	
	 
	 

	  public static ArrayList<State<WaterCupState>> finalStates(){

	      ArrayList<State<WaterCupState>> fStates = new ArrayList<State<WaterCupState>>();
	      
	      fStates.add(new State<WaterCupState>(new WaterCupState(0,2),null));
	      fStates.add(new State<WaterCupState>(new WaterCupState(1,2),null));
	      fStates.add(new State<WaterCupState>(new WaterCupState(2,2),null));
	      fStates.add(new State<WaterCupState>(new WaterCupState(3,2),null));

	      return fStates;
	  }

	
	  public static State<WaterCupState> initialState(){

	      return new State<WaterCupState>(new WaterCupState(), new InitialState());
	     
	  }

}

